#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;

int main()
{
	vector<int> tasks;
	int cur;
	while (cin >> cur) {
		tasks.push_back(cur);
	}
	for (int i = 0; i < tasks.size(); ++i) {
		if (i) printf(",");
		printf("(%d,%d)", i, tasks[i]);
	}
	cout << endl << endl;

	queue<int> qs, qu;
	vector<pair<int, int>> vs, vu;
	for (int i = 0; i < tasks.size(); ++i) {
		if (tasks[i] > 255) continue;
		if (tasks[i] < 50) vs.push_back({ i, tasks[i] });
		else vu.push_back({ i, tasks[i] });
	}
	sort(vs.begin(), vs.end(), [](const auto& l, const auto& r) {
		return l.second < r.second;
	});
	sort(vu.begin(), vu.end(), [](const auto& l, const auto& r) {
		return l.second < r.second;
	});
	if (vs.empty()) cout << "none";
	for (int i = 0; i < vs.size(); ++i) {
		qs.push(vs[i].first);
		cout << vs[i].first << ' ';
	}	cout << endl;
	if (vu.empty()) cout << "none";
	for (int i = 0; i < vu.size(); ++i) {
		qu.push(vu[i].first);
		cout << vu[i].first << ' ';
	}
	return 0;
}